﻿using System;
using System.Security.Principal;

namespace DoNetTool.Common.Core
{
    /// <summary>
    /// 
    /// </summary>
    public class ClientLoginUser : IPrincipal
    {
        /// <summary>
        /// 
        /// </summary>
        public string Key;

        /// <summary>
        /// 
        /// </summary>
        public string Role { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public IIdentity Identity
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        public bool IsInRole(string role)
        {
            if (string.IsNullOrEmpty(Role))
                return false;
            return Role.Equals(role);
        }
    }

}
